/*
	2^k个选手
	1.每个选手一天只能赛一次
	2.每个选手必须和其他n-1个选手赛一次
	3.一共进行n-1天
*/

#include<stdio.h>
#define N 50

void gameTable(int k)
{
	int a[100][100];
	int n,temp,i,j,p,t;

	n = 2;

	a[1][1] = 1;
	a[1][2] = 2;
	a[2][1] = 2;
	a[2][2] = 1;

	for (t = 1; t < k; t++)
	{
		temp = n;
		n = n*2;

		for (i = temp + 1; i <= n; i++)
		{
			for (j = 1; j <= temp; j++)
			{
				a[i][j] = a[i - temp][j] + temp;
				//左上角和左下角的关系
			}
		}

		for (i = 1; i <= temp; i++)
		{
			for (j = temp + 1; j <= n; j++)
			{
				a[i][j] = a[i + temp][(j + temp)%n];
				//左下角的元素抄到右上角
			}
		}

		for (i = temp + 1; i<= n; i++)
		{
			for (j = 1; j<= temp; j++)
			{
				a[i][j] = a[i - temp][j - temp];
				//左上角的元素抄到右下角
			}
		}
	}
}